package schema

import (
	"entgo.io/ent"
	"entgo.io/ent/schema/field"
	"time"
)

// Anniversary holds the schema definition for the Anniversary entity.
type Anniversary struct {
	ent.Schema
}

// Fields of the Anniversary.
func (Anniversary) Fields() []ent.Field {
	return []ent.Field{
		field.String("title").
			NotEmpty().
			Comment("标题"),
		field.Time("date").
			Comment("日期"),
		field.String("type").
			Default("其他").
			Comment("类型：恋爱纪念日/生日/第一次见面/其他"),
		field.Text("description").
			Optional().
			Comment("描述"),
		field.Time("created_at").
			Default(time.Now).
			Immutable().
			Comment("创建时间"),
		field.Time("updated_at").
			Default(time.Now).
			UpdateDefault(time.Now).
			Comment("更新时间"),
	}
}

// Edges of the Anniversary.
func (Anniversary) Edges() []ent.Edge {
	return nil
}
